package com.lmiot.xyclick.Bean.SQL;

import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import org.greenrobot.greendao.internal.DaoConfig;

public class ActionBeanDao extends AbstractDao<ActionBean, Long> {
    public static final String TABLENAME = "ACTION_BEAN";

    public static class Properties {
        public static final Property ActionID = new Property(1, String.class, "actionID", false, "ACTION_ID");
        public static final Property ActionName = new Property(2, String.class, "actionName", false, "ACTION_NAME");
        public static final Property ActionType = new Property(3, String.class, "actionType", false, "ACTION_TYPE");
        public static final Property AutoID = new Property(8, String.class, "autoID", false, "AUTO_ID");
        public static final Property Color = new Property(11, String.class, "color", false, "COLOR");
        public static final Property CreateTime = new Property(7, String.class, "createTime", false, "CREATE_TIME");
        public static final Property Delay = new Property(4, Integer.TYPE, "delay", false, "DELAY");
        public static final Property Detail = new Property(6, String.class, "detail", false, "DETAIL");
        public static final Property Enable = new Property(12, Boolean.TYPE, "enable", false, "ENABLE");
        public static final Property Icon = new Property(10, String.class, "icon", false, "ICON");
        public static final Property Id = new Property(0, Long.class, "id", true, "_id");
        public static final Property Mark = new Property(15, String.class, "mark", false, "MARK");
        public static final Property SortNum = new Property(5, Integer.TYPE, "sortNum", false, "SORT_NUM");
        public static final Property Unit = new Property(13, String.class, "unit", false, "UNIT");
        public static final Property UseTime = new Property(9, Integer.TYPE, "useTime", false, "USE_TIME");
        public static final Property Uuid = new Property(14, String.class, "uuid", false, "UUID");
    }

    /* access modifiers changed from: protected */
    @Override // org.greenrobot.greendao.AbstractDao
    public final boolean isEntityUpdateable() {
        return false;
    }

    public ActionBeanDao(DaoConfig daoConfig) {
        super(daoConfig);
    }

    public ActionBeanDao(DaoConfig daoConfig, DaoSession daoSession) {
        super(daoConfig, daoSession);
    }

    public static void createTable(Database database, boolean z) {
        String str = z ? "IF NOT EXISTS " : "";
        database.execSQL("CREATE TABLE " + str + "\"ACTION_BEAN\" (\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ,\"ACTION_ID\" TEXT UNIQUE ,\"ACTION_NAME\" TEXT,\"ACTION_TYPE\" TEXT,\"DELAY\" INTEGER NOT NULL ,\"SORT_NUM\" INTEGER NOT NULL ,\"DETAIL\" TEXT,\"CREATE_TIME\" TEXT,\"AUTO_ID\" TEXT,\"USE_TIME\" INTEGER NOT NULL ,\"ICON\" TEXT,\"COLOR\" TEXT,\"ENABLE\" INTEGER NOT NULL ,\"UNIT\" TEXT,\"UUID\" TEXT,\"MARK\" TEXT);");
    }

    public static void dropTable(Database database, boolean z) {
        StringBuilder sb = new StringBuilder();
        sb.append("DROP TABLE ");
        sb.append(z ? "IF EXISTS " : "");
        sb.append("\"ACTION_BEAN\"");
        database.execSQL(sb.toString());
    }

    /* access modifiers changed from: protected */
    public final void bindValues(DatabaseStatement databaseStatement, ActionBean actionBean) {
        databaseStatement.clearBindings();
        Long id = actionBean.getId();
        if (id != null) {
            databaseStatement.bindLong(1, id.longValue());
        }
        String actionID = actionBean.getActionID();
        if (actionID != null) {
            databaseStatement.bindString(2, actionID);
        }
        String actionName = actionBean.getActionName();
        if (actionName != null) {
            databaseStatement.bindString(3, actionName);
        }
        String actionType = actionBean.getActionType();
        if (actionType != null) {
            databaseStatement.bindString(4, actionType);
        }
        databaseStatement.bindLong(5, (long) actionBean.getDelay());
        databaseStatement.bindLong(6, (long) actionBean.getSortNum());
        String detail = actionBean.getDetail();
        if (detail != null) {
            databaseStatement.bindString(7, detail);
        }
        String createTime = actionBean.getCreateTime();
        if (createTime != null) {
            databaseStatement.bindString(8, createTime);
        }
        String autoID = actionBean.getAutoID();
        if (autoID != null) {
            databaseStatement.bindString(9, autoID);
        }
        databaseStatement.bindLong(10, (long) actionBean.getUseTime());
        String icon = actionBean.getIcon();
        if (icon != null) {
            databaseStatement.bindString(11, icon);
        }
        String color = actionBean.getColor();
        if (color != null) {
            databaseStatement.bindString(12, color);
        }
        databaseStatement.bindLong(13, actionBean.getEnable() ? 1 : 0);
        String unit = actionBean.getUnit();
        if (unit != null) {
            databaseStatement.bindString(14, unit);
        }
        String uuid = actionBean.getUuid();
        if (uuid != null) {
            databaseStatement.bindString(15, uuid);
        }
        String mark = actionBean.getMark();
        if (mark != null) {
            databaseStatement.bindString(16, mark);
        }
    }

    /* access modifiers changed from: protected */
    public final void bindValues(SQLiteStatement sQLiteStatement, ActionBean actionBean) {
        sQLiteStatement.clearBindings();
        Long id = actionBean.getId();
        if (id != null) {
            sQLiteStatement.bindLong(1, id.longValue());
        }
        String actionID = actionBean.getActionID();
        if (actionID != null) {
            sQLiteStatement.bindString(2, actionID);
        }
        String actionName = actionBean.getActionName();
        if (actionName != null) {
            sQLiteStatement.bindString(3, actionName);
        }
        String actionType = actionBean.getActionType();
        if (actionType != null) {
            sQLiteStatement.bindString(4, actionType);
        }
        sQLiteStatement.bindLong(5, (long) actionBean.getDelay());
        sQLiteStatement.bindLong(6, (long) actionBean.getSortNum());
        String detail = actionBean.getDetail();
        if (detail != null) {
            sQLiteStatement.bindString(7, detail);
        }
        String createTime = actionBean.getCreateTime();
        if (createTime != null) {
            sQLiteStatement.bindString(8, createTime);
        }
        String autoID = actionBean.getAutoID();
        if (autoID != null) {
            sQLiteStatement.bindString(9, autoID);
        }
        sQLiteStatement.bindLong(10, (long) actionBean.getUseTime());
        String icon = actionBean.getIcon();
        if (icon != null) {
            sQLiteStatement.bindString(11, icon);
        }
        String color = actionBean.getColor();
        if (color != null) {
            sQLiteStatement.bindString(12, color);
        }
        sQLiteStatement.bindLong(13, actionBean.getEnable() ? 1 : 0);
        String unit = actionBean.getUnit();
        if (unit != null) {
            sQLiteStatement.bindString(14, unit);
        }
        String uuid = actionBean.getUuid();
        if (uuid != null) {
            sQLiteStatement.bindString(15, uuid);
        }
        String mark = actionBean.getMark();
        if (mark != null) {
            sQLiteStatement.bindString(16, mark);
        }
    }

    @Override // org.greenrobot.greendao.AbstractDao
    public Long readKey(Cursor cursor, int i) {
        int i2 = i + 0;
        if (cursor.isNull(i2)) {
            return null;
        }
        return Long.valueOf(cursor.getLong(i2));
    }

    @Override
    public ActionBean readEntity(Cursor cursor, int i) {
        int i2 = i + 0;
        Long valueOf = cursor.isNull(i2) ? null : Long.valueOf(cursor.getLong(i2));
        int i3 = i + 1;
        String string = cursor.isNull(i3) ? null : cursor.getString(i3);
        int i4 = i + 2;
        String string2 = cursor.isNull(i4) ? null : cursor.getString(i4);
        int i5 = i + 3;
        String string3 = cursor.isNull(i5) ? null : cursor.getString(i5);
        int i6 = cursor.getInt(i + 4);
        int i7 = cursor.getInt(i + 5);
        int i8 = i + 6;
        String string4 = cursor.isNull(i8) ? null : cursor.getString(i8);
        int i9 = i + 7;
        String string5 = cursor.isNull(i9) ? null : cursor.getString(i9);
        int i10 = i + 8;
        String string6 = cursor.isNull(i10) ? null : cursor.getString(i10);
        int i11 = cursor.getInt(i + 9);
        int i12 = i + 10;
        String string7 = cursor.isNull(i12) ? null : cursor.getString(i12);
        int i13 = i + 11;
        String string8 = cursor.isNull(i13) ? null : cursor.getString(i13);
        boolean z = cursor.getShort(i + 12) != 0;
        int i14 = i + 13;
        String string9 = cursor.isNull(i14) ? null : cursor.getString(i14);
        int i15 = i + 14;
        String string10 = cursor.isNull(i15) ? null : cursor.getString(i15);
        int i16 = i + 15;
        return new ActionBean(valueOf, string, string2, string3, i6, i7, string4, string5, string6, i11, string7, string8, z, string9, string10, cursor.isNull(i16) ? null : cursor.getString(i16));
    }

    public void readEntity(Cursor cursor, ActionBean actionBean, int i) {
        int i2 = i + 0;
        String str = null;
        actionBean.setId(cursor.isNull(i2) ? null : Long.valueOf(cursor.getLong(i2)));
        int i3 = i + 1;
        actionBean.setActionID(cursor.isNull(i3) ? null : cursor.getString(i3));
        int i4 = i + 2;
        actionBean.setActionName(cursor.isNull(i4) ? null : cursor.getString(i4));
        int i5 = i + 3;
        actionBean.setActionType(cursor.isNull(i5) ? null : cursor.getString(i5));
        actionBean.setDelay(cursor.getInt(i + 4));
        actionBean.setSortNum(cursor.getInt(i + 5));
        int i6 = i + 6;
        actionBean.setDetail(cursor.isNull(i6) ? null : cursor.getString(i6));
        int i7 = i + 7;
        actionBean.setCreateTime(cursor.isNull(i7) ? null : cursor.getString(i7));
        int i8 = i + 8;
        actionBean.setAutoID(cursor.isNull(i8) ? null : cursor.getString(i8));
        actionBean.setUseTime(cursor.getInt(i + 9));
        int i9 = i + 10;
        actionBean.setIcon(cursor.isNull(i9) ? null : cursor.getString(i9));
        int i10 = i + 11;
        actionBean.setColor(cursor.isNull(i10) ? null : cursor.getString(i10));
        actionBean.setEnable(cursor.getShort(i + 12) != 0);
        int i11 = i + 13;
        actionBean.setUnit(cursor.isNull(i11) ? null : cursor.getString(i11));
        int i12 = i + 14;
        actionBean.setUuid(cursor.isNull(i12) ? null : cursor.getString(i12));
        int i13 = i + 15;
        if (!cursor.isNull(i13)) {
            str = cursor.getString(i13);
        }
        actionBean.setMark(str);
    }

    /* access modifiers changed from: protected */
    public final Long updateKeyAfterInsert(ActionBean actionBean, long j) {
        actionBean.setId(Long.valueOf(j));
        return Long.valueOf(j);
    }

    public Long getKey(ActionBean actionBean) {
        if (actionBean != null) {
            return actionBean.getId();
        }
        return null;
    }

    public boolean hasKey(ActionBean actionBean) {
        return actionBean.getId() != null;
    }
}
